﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Itasa.API
{
    internal class Season : IComparable, IComparable<Season>
    {

        internal String SeasonNumber { get; private set; }
        internal List<Sub> Subs { get; private set; }

        internal Season(String number)
        {
            this.SeasonNumber = number;
            this.Subs = new List<Sub>();
        }

        internal void AddSub(Sub s)
        {
            Subs.Add(s);
        }

        public int CompareTo(object obj)
        {
            if (obj is Season) return this.SeasonNumber.CompareTo((obj as Season).SeasonNumber);
            return 0;
        }

        public int CompareTo(Season other)
        {
            if (other == null) throw new ArgumentNullException("other");
            return this.SeasonNumber.CompareTo(other.SeasonNumber);
        }

        public override bool Equals(object obj)
        {
            if (obj is Season) return this.SeasonNumber.Equals((obj as Season).SeasonNumber);
            return false;
        }
    }
}
